-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for token-based usage metrics. #8757
Conversation
Token measurement is broken down by modaliy, with separate counters for image, audio, etc. Tests are in version 6.*, so this change also includes bumping update_responses.sh
🦋 Changeset detectedLatest commit: 6f90b2e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just need to add a changeset - yarn changeset
, choose "@firebase/vertexai" (should already be selected) and "firebase" (won't be selected) and select "minor" for both. If you can't select "firebase" that's ok, you can also add 'firebase': minor
manually in the resulting changeset file after it's created.
@@ -213,4 +228,6 @@ export interface CountTokensResponse { | |||
* from the request. | |||
*/ | |||
totalBillableCharacters?: number; | |||
|
|||
promptTokensDetails?: ModalityTokenCount[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want docs on this property? If so, add it in the same comment format as the two other properties above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, thanks!
BTW, why are enums
shown as (undocumented) in the generated .md file?
Oh sorry, can you run |
Changeset File Check ✅
|
// Point it to your entry point d.ts file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, I needed to make this change otherwise the tool wouldn't run correctly. Should I leave it in the PR or remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about this again, this might be because of an updated rollup plugin dependency that was merged after you made this branch. The old plugin would write to the path you've updated it to, the new version writes to the new path - this change is causing the docgen step to fail in CI now.
Locally can you try deleting node_modules and reinstalling deps?
// in the root of the repo
rm -fr node_modules
yarn
// try docgen again
yarn docgen:all
Co-authored-by: rachelsaunders <[email protected]>
docs-devsite/vertexai.md
Outdated
| Member | Value | Description | | ||
| --- | --- | --- | | ||
| AUDIO | <code>"AUDIO"</code> | Audio. | | ||
| DOCUMENT | <code>"DOCUMENT"</code> | Document, e.g. PDF. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DOCUMENT | <code>"DOCUMENT"</code> | Document, e.g. PDF. | | |
| DOCUMENT | <code>"DOCUMENT"</code> | Document (for example, PDF). | |
Token measurement is broken down by modaliy, with separate counters for image, audio, etc.
Tests are in version 6.*, so this change also includes bumping update_responses.sh
Internal API proposal doc: go/firebase-vertex-token-modality-api